package org.xinjiang.data.migration.flush.enums;

import lombok.Getter;

/**
 * 人员编制
 */
@Getter
public enum OrganizationEnum {
    SPECIAL_STAFFING_FOR_POLITICAL_AND_LEGAL_AFFAIRS("1", "政法专项编制", "1", null),
    LOCAL_ADMINISTRATIVE_STAFFING("2", "地方行政编制", "2", null),
    STAFFING_OF_GOVERNMENT_AFFILIATED_INSTITUTIONS("3", "事业编制", "3", null),
    EMPLOY("4", "聘用", "4", null),
    UNKNOWN("99", "其他", "5", null);

    /**
     * 数据来源code
     */
    private String sourceCode;

    /**
     * 数据来源名成
     */
    private String sourceName;


    private String targetCode;

    private Integer id;

    OrganizationEnum(String sourceCode, String sourceName, String targetCode, Integer id) {
        this.sourceCode = sourceCode;
        this.sourceName = sourceName;
        this.targetCode = targetCode;
        this.id = id;
    }

    public static OrganizationEnum toCode(String sourceCode) {
        for (OrganizationEnum value : OrganizationEnum.values()) {
            if (value.sourceCode.equals(sourceCode)) {
                return value;
            }
        }
        return UNKNOWN;
    }

}
